<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div id="box">
        <!-- {{myname | mydatafilter}} 通过函数表达式调用形式,将原始数据作为形参传入变量 -->
        {{ mydatafilter(myname)}}  
    </div>
</body>
<script>
    var obj = {
        data(){
            return{
                myname:'zhangsan',
            }
        },
        methods:{   //将filters过滤器更改为methods方法
            mydatafilter(a){   //通过方法形参传入实现过滤器功能
                console.log(a);   //会将原始数据当做形参传入
                return 11111
            }
        }
    }
    let app = Vue.createApp(obj).mount('#box');
</script>

</html>